#include "dut/ShaderFile.h"

void Dut::ShaderFile::Create(const std::string& path)
{

	std::vector<Dut::TextFile> texts =
	{
		{
			path + "/" + this->m_Name + ".hlsli",
			this->m_CommonContext
		},
		{
			path + "/" + this->m_Name + "_VS.hlsl",
			"#include \"" + this->m_Name + ".hlsli" + "\" " +
			this->m_VsContext
		},
		{
			path + "/" + this->m_Name + "_PS.hlsl",
			"#include \"" + this->m_Name + ".hlsli" + "\" " +
			this->m_PsContext}
		};

	for (const auto& tf : texts)
	{
		tf.Create();
	}
}

Dut::ShaderFile::ShaderFile(const std::string& name, const std::string& common, const std::string& vsCode, const std::string& psCode)
	:m_Name(name), m_CommonContext(common), m_VsContext(vsCode), m_PsContext(psCode)
{
}
;
